<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<?php if(!isset($hide))
	$hide = array(); ?>

<?php if(!isset($buttons)) $buttons=true?>
<?php if(!isset($formAction)){
	$formAction = url_for($module.'/'.($form->getObject()->isNew() ? 'create?className='.$className : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId().'&className='.$className : ''));
}?>
<?php if(!isset($target)){
	$target='';
}else{
	$target = "target=$target";
}?>
<form action="<?php echo $formAction ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?> tmt:validate = "true" tmt:callback="errorOnLabels" class="defaultForm <?php echo $target;?>">
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>


<?php echo $form->renderGlobalErrors() ?>
		<?php if(empty($objDef)) $objDef = new objectDef($className); ?>			
		<?php if($objDef->description): ?>
			<fieldset>
				<legend><?php echo __("General Information"); ?></legend>
		  			<div class="description">
		  				<?php echo $objDef->description?>
		  			</div>
		  	</fieldset>
		<?php endif;?>
		  <?php
		  echo $form; 
	   	  ?>
		  <?php if($buttons):?>
		  	<?php include_partial('defaultViewer/buttons', array('form' => $form,'module' => $module,'className' => $className, 'default'=>$default))  ?>
		  <?php endif;?>

<?php 
if(isset($form->extraTemplates)){
	if(is_array($form->extraTemplates)){
		foreach($form->extraTemplates as $template){
			include_partial($template, array('form'=>$form)); 
		}
	}
}
?>